/**
 * 设置定位
 * $mode: 采用的定位方式 position 或者 display
 * $$diration: 对齐方式 center horization vertication
 */
@mixin set-location($mode: position, $direction: horization) {
  @if $mode == position {
    position: relative;
    @if $direction == horization {
      left: 50%;
      transform: translateX(-50%);
    } @else if $direction == vertication {
      top: 50%;
      transform: translateY(-50%);
    } @else {
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
    }
  } @else if $mode == display {
    display: flex;
    align-items: center;

    @if $direction == horization {
      // 水平居中
      flex-direction: row;
    } @else if $direction == vertication {
      // 垂直居中
      flex-direction: column;
    } @else {
      // 居中
      justify-content: center;
    }
  }
}
